Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use noninteractive sudo when running podman #7959

Merged
merged 5 commits into from
May 11, 2020

Conversation

afbjorklund
Copy link
Collaborator

@afbjorklund afbjorklund commented May 1, 2020

To avoid asking for a password in the middle of minikube commands.

The setup process is supposed to involve adding podman to sudoers...

Fixes #7958

Related to #7960 in that it runs podman, no matter what driver is used.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 1, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afbjorklund

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 1, 2020
@afbjorklund afbjorklund requested a review from medyagh May 1, 2020 12:32
@afbjorklund
Copy link
Collaborator Author

@medyagh : why do we need to run an extra cleanup like this, outside all machines etc ?

isn't enough to delete the volume when the container is removed, since they are all "named"

To avoid asking for a password in the middle of minikube commands.

The setup process is supposed to involve adding podman to sudoers...
When deleting all minikube profiles, that is
Avoids spamming the log with extra drivers
We want to verify that "NOPASSWD" has been set up properly

Otherwise the sudo timestamp might time out (after 15 mins)
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 9, 2020
@afbjorklund afbjorklund self-assigned this May 9, 2020
@medyagh
Copy link
Member

medyagh commented May 11, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label May 11, 2020
errs = oci.PruneAllVolumesByLabel(oci.Docker, delLabel)
if ociBin == oci.Podman {
// podman prune does not support --filter
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this line it seems to return and wont go to the deleteall process?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The operation is not supported (volume prune) on podman, so we can only list-and-delete

@@ -137,7 +142,8 @@ func runDelete(cmd *cobra.Command, args []string) {
}

if deleteAll {
deleteContainersAndVolumes()
deleteContainersAndVolumes(oci.Docker)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe do them in parallel ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possibly, the theory is that one of them will be "empty"

@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: [74.664288591 65.943991606 72.65843072800001]
Average time for minikube: 71.08890364166668

Times for Minikube (PR 7959): [68.42498932000001 69.372956699 66.063275534]
Average time for Minikube (PR 7959): 67.95374051766667

Averages Time Per Log

+--------------------------------+-----------+--------------------+
|              LOG               | MINIKUBE  | MINIKUBE (PR 7959) |
+--------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.2 on   |  0.068692 |           0.067378 |
| Debian 9.11                    |           |                    |
| * Using the kvm2 driver based  |  0.023577 |           0.024194 |
| on existing profile            |           |                    |
| * Starting control plane node  |  0.004969 |           0.004195 |
| minikube in cluster minikube   |           |                    |
| * Creating kvm2 VM (CPUs=2,    | 43.433924 |          42.596069 |
| Memory=3700MB, Disk=20000MB)   |           |                    |
| ...                            |           |                    |
| * Preparing Kubernetes v1.18.1 | 25.007105 |          23.201797 |
| on Docker 19.03.8 ...          |           |                    |
| * Verifying Kubernetes         |  1.993509 |           1.514166 |
| components...                  |           |                    |
| * Enabled addons:              |  0.469768 |           0.462121 |
| default-storageclass,          |           |                    |
| storage-provisioner            |           |                    |
| * Done! kubectl is now         |  0.083086 |           0.076900 |
| configured to use "minikube"   |           |                    |
|                                |  0.004273 |           0.006921 |
+--------------------------------+-----------+--------------------+

docker Driver
Times for minikube: [29.193665907000003 28.562579064999994 29.190706808999998]
Average time for minikube: 28.982317260333335

Times for Minikube (PR 7959): [28.681519867000002 29.911240598000003 27.528685352]
Average time for Minikube (PR 7959): 28.707148605666664

Averages Time Per Log

+----------------------------------------+-----------+--------------------+
|                  LOG                   | MINIKUBE  | MINIKUBE (PR 7959) |
+----------------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.2 on           |  0.077448 |           0.080189 |
| Debian 9.11                            |           |                    |
| * Using the docker driver              |  0.002903 |           0.003118 |
| based on existing profile              |           |                    |
| * Starting control plane node          |  0.061581 |           0.062879 |
| minikube in cluster minikube           |           |                    |
| * Creating docker container            |  8.277253 |           8.130007 |
| (CPUs=2, Memory=3700MB) ...            |           |                    |
| * Preparing Kubernetes v1.18.1         |  0.129195 |           0.127282 |
| on Docker 19.03.2 ...                  |           |                    |
|   -                                    | 18.750842 |          19.286580 |
| kubeadm.pod-network-cidr=10.244.0.0/16 |           |                    |
| * Verifying Kubernetes                 |  1.552581 |           0.937270 |
| components...                          |           |                    |
| * Enabled addons:                      |  0.056174 |           0.003281 |
| default-storageclass,                  |           |                    |
| storage-provisioner                    |           |                    |
| * Done! kubectl is now                 |  0.070476 |           0.068354 |
| configured to use "minikube"           |           |                    |
|                                        |  0.003864 |           0.008188 |
+----------------------------------------+-----------+--------------------+

@medyagh medyagh merged commit afab7c8 into kubernetes:master May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deleting Docker cluster hangs on password prompt: sudo podman ps
5 participants